Skip to content

Conversation

@reedmclean
Copy link
Contributor

Right now, we will choke on any attachments that are just a file URL and not actual contents of the file being referenced. Changed the look-up for the hash to be a little more careful instead of assuming that an attachment with that hash will exist.

Getting this to run required a bit of catch up, since no one has touched this repo is a couple years. The first commit is just some small stuff like specifying a specific version of phpunit (one which is no longer supported, but that's a different PR), updating the versions of xAPI we support, updated phpunit.xml, etc.

@reedmclean reedmclean changed the title File url attachments Added support for file URL attachments #99 Aug 24, 2018
@reedmclean reedmclean changed the title Added support for file URL attachments #99 Added support for file URL attachments Aug 24, 2018
Seems like a couple things have changed since we last ran the tests 2 years ago. Updated phpunit version number because some class names changed, phpunit.xml needed to be changed, reference v1.0.3 of xAPI, and fixed some Exception language that seems to have changed.
Copy link
Member

@brianjmiller brianjmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple quick comments.

convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason to disable the syntaxCheck?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntaxCheck isn't in the latest version of phpunit. I guess I removed this before I specified the version of phpunit we're using. I'll revert it.

public function testRetrieveStatementWithFileUrlAttachments() {
$lrs = new RemoteLRS(self::$endpoint, self::$version, self::$username, self::$password);
$attachments = new Attachment();
$pdfUrl = 'http://www.adlnet.gov/wp-content/uploads/2013/10/xAPI_v1.0.1-2013-10-01.pdf';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this won't get fetched, but we probably don't want to point to an external resource, nor include another file in the repo for this purpose. See the tests/files/image.jpg which can be linked at https://github.com/RusticiSoftware/TinCanPHP/raw/master/tests/files/image.jpg (could also point at one of the raw github services).

@reedmclean reedmclean merged commit 0abbc06 into RusticiSoftware:master Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants